package com.dys.testsuperconstructor;

/**
 * @className: com.dys.testsuperconstructor.Student
 * @description: com.dys.testsuperconstructor
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/07/18 下午10:35
 */
public class Student extends BasePerson {
    int sno;

    public Student() {
        super();
    }

    public Student(int sno) {
        super();
        this.sno = sno;
    }

    public Student(int age, String name, int sno) {
        // this.age = age;
        // this.name = name;
        // 写法二
        // super.age=age;
        // super.name=name;
        // 写法三: 利用super调用父类构造器
        super(age, name);
        this.sno = sno;
        // 写法四：子类和父类不能共存，只能存在一个
        // this(sno);
    }
}
